import { createRouter,createWebHistory } from "vue-router";
import Login from '../views/Login.vue';
import Register from "../views/Register.vue";
import Show from '../views/Show.vue';
import Friend from "../views/Friend.vue";
import Home from "../views/Home.vue";
import Community from "../views/Community.vue";
import Post from "../views/Post.vue";
import MakePost from "../views/MakePost.vue";
const router=createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:"/login",
            component:Login
        },
        {
            path:"/register",
            component:Register
        },
        {
            path:"/show",
            component:Show,
            children:[
                {
                    path:"/friend",
                    component:Friend
                },
                {
                    path:"/home",
                    component:Home
                },
                {
                    path:"/community",
                    component:Community
                },
                {
                    path:'/show',
                    redirect:'/community'
                }  
            ]

        },
        {
            path:"/post",
            component:Post
        },        
        {
            path:"/makePost",
            component:MakePost
        },
          {
            path:'/',
            redirect:'/login'
        }  
    ]

})

export default router